Skip to content

Add version constraints to cargo dependencies#70

Open
cottsay wants to merge 1 commit intomainfrom
cottsay/versions
Open

Add version constraints to cargo dependencies#70
cottsay wants to merge 1 commit intomainfrom
cottsay/versions

Conversation

@cottsay
Copy link
Member

@cottsay cottsay commented Feb 7, 2026

This change brings support for reading the version constraints from the dependencies specified in Cargo.toml manifests. It supports the full range of syntax with the exception of complex wildcards such as 1.*.3.

The behavior enabled by this change aligns colcon-cargo with other build system extensions, and will notify the user with a warning during a build where an incompatible version of a package is present in a workspace which has one or more other packages requiring a different version of it.

Example message:

colcon.colcon_core.package_augmentation.check_dependency_constraint WARNING cargo-package-a depends on cargo-package-b which has version 1.1.0 but expects it to be greater than or equal to 1.3.0

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#version-requirement-syntax

@cottsay cottsay self-assigned this Feb 7, 2026
@cottsay cottsay added the enhancement New feature or request label Feb 7, 2026
@codecov-commenter
Copy link

codecov-commenter commented Feb 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.76%. Comparing base (518a4f9) to head (307bb25).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #70      +/-   ##
==========================================
+ Coverage   72.46%   75.76%   +3.30%     
==========================================
  Files           9        9              
  Lines         345      392      +47     
  Branches       60       73      +13     
==========================================
+ Hits          250      297      +47     
  Misses         61       61              
  Partials       34       34              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cottsay cottsay force-pushed the cottsay/versions branch 2 times, most recently from 2a183a1 to 608c8a5 Compare February 18, 2026 22:25
This change brings support for reading the version constraints from the
dependencies specified in Cargo.toml manifests. It supports the full
range of version syntax accepted by cargo.

The behavior enabled by this change aligns colcon-cargo with other build
system extensions, and will notify the user with a warning during a
build where an incompatible version of a package is present in a
workspace which has one or more other packages requiring a different
version of it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

2 participants